<%@ page import="cn.kgc.util.PageSupport" %>
<%@ page import="cn.kgc.service.NewsDetailService" %>
<%@ page import="cn.kgc.service.NewsDetailServiceImpl" %>
<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");
    String categoryId= request.getParameter("categoryId");
    String title=  request.getParameter("title");
    NewsDetailService newsService =new NewsDetailServiceImpl();
    PageSupport pageSupport =new PageSupport();
    Integer id=null;
    if(categoryId!=null){id=Integer.parseInt(categoryId);
        if(id==0){
            id=null;
        }
    }
    pageSupport =newsService.getNewsDetailListByPage(title,id,pageSupport);
    request.setAttribute("page",pageSupport);
    //数据回显
    request.setAttribute("title",title);
    request.setAttribute("categoryId",categoryId);
    request.getRequestDispatcher("/day04/newsDetailList.jsp").forward(request,response);

%>